from conan import ConanFile
from conan.tools.files import copy
from os.path import join

class SimplemqCppConan(ConanFile):
    name = "simplemq-cpp"
    version = "0.0.2-dev"
    description = "simple Message Queue, 实现支持消息推送的中间件"
    url = "https://gitee.com/l0km/simplemq-cpp"
    license = "BSD-2-Clause"
    author = "guyadong 10km0811@sohu.com"
    topics = ("messagequeue", "c++11","json")

    package_type = "header-library"
    settings = "os", "compiler"

    requires = "common_source_cpp/1.0.1"
    exports_sources = "include/*","LICENSE"

    def package(self):
        copy(self, "*",join(self.source_folder,"include"),join(self.package_folder,"include"))
        copy(self,"LICENSE", self.source_folder,join(self.package_folder,"licenses"))

    def package_id(self):
        self.info.clear()

    def package_info(self):
        if self.settings.compiler == "msvc":
            self.cpp_info.defines = ["NOMINMAX"]
        if self.settings.os == "Android":
            self.cpp_info.libs = ["log"]
        if self.settings.os == "Linux":
            self.cpp_info.libs = ["pthread","dl"]
        self.cpp_info.requires=["common_source_cpp::common_source_cpp"]

